package com.线程案例;

import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/2/26  8:29
 * 描述:
 */
public class MyGoodsRun2 implements Callable {

    private List<Map<String,Object>> list;

    private CountDownLatch countDownLatch;

    public MyGoodsRun2(List<Map<String, Object>> list, CountDownLatch countDownLatch) {
        this.list = list;
        this.countDownLatch = countDownLatch;
    }

    @Override
    public Object call() throws Exception {

        for (Map<String, Object> map : list) {
            map.put("goodsName",new Random().nextDouble()+"商品名称" );
            map.put("brandName",new Random().nextDouble()+"品牌名称" );
            map.put("goodsStyle",new Random().nextDouble()+"商品规格" );
            map.put("goodsCode",new Random().nextDouble()+"商品编码" );
            map.put("goodsName",new Random().nextDouble()+"商品名称" );
            map.put("XXXX",new Random().nextDouble()+"商品名称" );
            map.put("YYYY",new Random().nextDouble()+"商品名称" );
            map.put("TTTT",new Random().nextDouble()+"商品名称" );
            map.put("UUUU",new Random().nextDouble()+"商品名称" );
        }

        countDownLatch.countDown();

        return list;
    }




}
